# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=lua-soap
pkgver=3.0
_pkgver=${pkgver/./_}
pkgrel=0
pkgdesc="Lua library to ease the use of SOAP"
url="http://tomasguisasola.github.io/luasoap/"
arch="noarch"
license="MIT"
depends="lua-expat lua-socket"
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages=""
source="https://github.com/tomasguisasola/luasoap/archive/v$_pkgver.tar.gz"

_builddir="$srcdir"/luasoap-$_pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	make || return 1
}

package() {
	cd "$_builddir"
	make LUA_DIR="$pkgdir"/usr/share/lua/5.1 install || return 1

	# https://github.com/tomasguisasola/luasoap/issues/7
	mv "$pkgdir"/usr/share/lua/5.1/soap/soap.lua \
	   "$pkgdir"/usr/share/lua/5.1/soap.lua || return 1
}

sha512sums="de0fa591f5bc9bbf9740660edd4482289bca2139e60119cb5607304cd7afdf6b0d63aedf5c67386022d538a5f8d206323fada49e8ae268f297dec71eda2bc0ad  v3_0.tar.gz"
